From bacceae3b8661b844a0f4eca149e80f21db3fdb9 Mon Sep 17 00:00:00 2001 From: robertlipe Date: Thu, 13 Feb 2014 03:11:50 +0000 Subject: [PATCH] Add some automation for Coverity. --- gpsbabel/Makefile.in | 8 ++++++++ gpsbabel/coverity_model.cc | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 gpsbabel/coverity_model.cc diff --git a/gpsbabel/Makefile.in b/gpsbabel/Makefile.in index cd17c269a..e4299e614 100644 --- a/gpsbabel/Makefile.in +++ b/gpsbabel/Makefile.in @@ -417,6 +417,14 @@ test-release: doc gpsbabel.html changes.html rm -f gpsbabel-$(VERSIOND)/internal_styles.cc make release-tarball release-winbuild release-rpm +# Build entire tree, upload to Coverity. +cov-upload: FORCE + make clean + cov-build --dir cov-int make + echo If that says 100%, press enter. Otherwise interrupt. + read junk + cov-upload + # Machine generated from here down. alan.o: alan.cc defs.h config.h queue.h zlib/zlib.h zlib/zconf.h gbfile.h \ cet.h cet_util.h inifile.h session.h src/core/datetime.h diff --git a/gpsbabel/coverity_model.cc b/gpsbabel/coverity_model.cc new file mode 100644 index 000000000..35ea8a117 --- /dev/null +++ b/gpsbabel/coverity_model.cc @@ -0,0 +1,37 @@ +// This file is never compiled or linked into GPSBabel itself; it exists +// solely so we can VC the model of things we have to tell Coverity about +// to shush bogus positives. + +void fatal(const char *msg, ...) { + __coverity_panic__(); +} + +// Forward decls to make the signature match. +class Waypoint; +class route_head; +class QString; +class route; + +// These functions "claim" their arguments +void +waypt_add(Waypoint* wpt) { + __coverity_escape__; +} + + +void track_add_head(route_head* rte) { + __coverity_escape__; +} +void route_add_head(route_head* rte) { + __coverity_escape__; +} +void route_add_wpt(route_head* rte, Waypoint* wpt) { + __coverity_escape__; +} +void track_add_wpt(route_head* rte, Waypoint* wpt) { + __coverity_escape__; +} +void route_add_wpt_named(route_head* rte, Waypoint* wpt, + const QString& namepart, int number_digits) { + __coverity_escape__; +} -- 2.30.2